package com.laikan.reader.core.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import com.laikan.reader.core.LaikanBaseAdapter;
import com.laikan.reader.R;
import com.laikan.reader.core.view.MyTextView;

/**
 * 享读规则
 *
 * @author Administrator
 */
public class ShareReadRuleAdapter extends LaikanBaseAdapter<String> {

    public ShareReadRuleAdapter(Context mContext) {
        super(mContext);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup arg2) {
        ViewHolder holder = null;
        if (convertView == null) {
            // 获取控件
            holder = new ViewHolder();
            convertView = View.inflate(mContext, R.layout.my_share_read_item, null);
            holder.tv_rule = (MyTextView)convertView.findViewById(R.id.tv_rule);
            holder.tv_rule.setOnClickListener(null);
            convertView.setTag(holder);

        }else {
            holder = (ViewHolder)convertView.getTag();
        }
        //        holder.tv_rule.setText(datas.get(position));

        if(position == 0){
            holder.tv_rule.setSpecifiedTextsColor(datas.get(position), "非vip用户无法获得vip成长值", Color.parseColor("#FF5048"));
        }else if (position == 1) {
            holder.tv_rule.setSpecifiedTextsColor(datas.get(position), "抽奖机会当天24时前有效", Color.parseColor("#FF5048"));
        }else {
            holder.tv_rule.setSpecifiedTextsColor(datas.get(position), "补签没有签到奖励", Color.parseColor("#FF5048"));
        }



        return convertView;
    }

    private class ViewHolder {

        private MyTextView tv_rule;
    }

}
